package business_class;

import java.util.HashMap;

import com.ailk.cuc.autotestbg.common.utils.SpringContextUtil;
import com.ailk.cuc.autotestbg.xml.business.impl.ecs.EcsAssemblyComponentImpl;
import com.ailk.cuc.autotestbg.xml.business.impl.ecs.EcsReplaceComponentImpl;
import com.ailk.cuc.autotestbg.xml.business.impl.ecs.EcsSendOutComponentImpl;
import com.ailk.cuc.autotestbg.xml.exception.EcsAssemblyException;
import com.ailk.cuc.autotestbg.xml.exception.EcsReplaceException;
import com.ailk.cuc.autotestbg.xml.exception.EcsSendOutException;

public class CheckUserOrder {

	public String testCheckUserOrder(HashMap<String,Object> argMapIn,HashMap<String,Object> argMapOut){

		
		String result = "0000";
		EcsAssemblyComponentImpl assemblyComponent;
		EcsReplaceComponentImpl replaceComponent;
		EcsSendOutComponentImpl sendOutComponent;
		try {
			assemblyComponent = (EcsAssemblyComponentImpl)SpringContextUtil.getBean("ecsAssemblyComponent");
			assemblyComponent.assemblyInfo(argMapIn,argMapOut);
			
			replaceComponent = (EcsReplaceComponentImpl)SpringContextUtil.getBean("ecsReplaceComponent");
			replaceComponent.replaceInfo(argMapIn,argMapOut);
			
			sendOutComponent = (EcsSendOutComponentImpl)SpringContextUtil.getBean("ecsSendOutComponent");
			sendOutComponent.sendOutInfo(argMapIn,argMapOut);
		} catch (EcsAssemblyException e1) {
			e1.printStackTrace();
			result = "0001";
		} catch (EcsReplaceException e1) {
			e1.printStackTrace();
			result = "0002";
		} catch (EcsSendOutException e1) {
			e1.printStackTrace();
			result = "0003";
		} 
		
		return result;
	}
}
